*** REPLICATION TOOLKIT ***

* AUTHORS: CIMINELLI DUVAL FURCERI 

* ARTICLE: EMPLOYMENT PROTECTION DEREGULATION AND LABOR SHARES IN ADVANCED ECONOMIES 

* JOURNAL: REVIEW OF ECONOMICS AND STATISTICS

* OUTPUT: FIGURE 3, PANEL C

***************************

cd ""

global horizon 6 
global ci = 1.645

************ PREPARE DATASET **********

run "Do files/Clean dataset"

************ ANALYSIS AND GRAPHS **********

forvalues s = 2 / 4 {
matrix baseline = J($horizon,4,.)
forvalues i= 1/$horizon {
quietly reghdfe  Y`i' r`s' l1Y l2Y l3Y l4Y l1r`s' l2r`s' l3r`s' l4r`s' t2 ${f`i'`s'}, absorb(id_cross_section i.year#id_country i.year#id_industry) cluster(ifscode year) nocons
matrix results = r(table)
matrix baseline[`i',1] = results[1,1]
matrix baseline[`i',2] = results[2,1]
matrix baseline[`i',3] = results[1,1] + $ci*results[2,1]
matrix baseline[`i',4] = results[1,1] - $ci*results[2,1]
}
matrix coeff`s' = baseline[1...,"c1"]
matrix ci_p`s' = baseline[1...,"c3"]
matrix ci_n`s' = baseline[1...,"c4"]
svmat coeff`s'
svmat ci_p`s'
svmat ci_n`s'
capture drop horizon
egen horizon = group(year) 
replace horizon = . if coeff`s'1==.
}

* Create graph
graph set window fontface "Times New Roman"
graph twoway line coeff2 ci_p2 ci_n2 horizon, graphregion(color(white)) ytitle("") xtitle("") yline(0, lcolor(black)) xlabel(, nolabels) legend(off) lpattern(solid shortdash shortdash) lwidth (thick thick thick) lcolor(blue red red) subtitle("{bf:Panel A.} Identification through layoff rates") ysize(10) xsize(15) ylab(-5(1)0)
graph copy A, replace
graph twoway line coeff3 ci_p3 ci_n3 horizon, graphregion(color(white)) ytitle("") xtitle("") yline(0, lcolor(black)) xlabel(, nolabels) legend(off) lpattern(solid shortdash shortdash) lwidth (thick thick thick) lcolor(blue red red) subtitle("{bf:Panel B.} Identification through elasticities of substitution") ysize(10) xsize(15) ylab(-5(1)0)
graph copy B, replace
graph twoway line coeff4 ci_p4 ci_n4 horizon, graphregion(color(white)) ytitle("") xtitle("") yline(0, lcolor(black))  legend(off) lpattern(solid shortdash shortdash) lwidth (thick thick thick) lcolor(blue red red) subtitle("{bf:Panel C.} Identification through layoff rates and elasticities of substitution") ysize(10) xsize(15) ylab(-5(1)0) xlab(1 "0"2 "1"3 "2"4 "3"5 "4"6 "5") 
graph copy C, replace

graph combine A B C, cols(1) graphregion(color(white)) ysize(20) xsize(13)
graph export "Figures/4.png", replace
